#include<stdio.h>
#include<stdlib.h>
#include<string.h>

//typedef int INT32
#define INT32 int
#define DM_FAILURE 0
#define DM_SUCCESS 1

INT32 get_single_line_value_from_file(char *file, char *value)
{
    INT32 lRet = DM_FAILURE;
    char line[128] = {0};
    FILE *fp = NULL;
    char *p = NULL;

    fp = fopen(file, "r");
    if(fp != NULL)
    {
        fgets(line, sizeof(line), fp);
        p = strchr(line, '\n');
        if(p != NULL)
        {
            *p = '\0';
        }
        sprintf(value, "%s", line);
        fclose(fp);
        lRet = DM_SUCCESS;
    }

    return lRet;
}

void main(int argc, char *argv)
{
	char value[256] = {0};

	get_single_line_value_from_file("/proc/sys/net/ipv4/tcp_available_congestion_control", value);
	printf("value = [%s]\n", value);	
}
